const state = {
    token: '',
    items: []
}
const actions = {
    saveLogin: ({ commit }, payload) => {
        console.log('保存', payload)
        commit('SAVELOGIN', payload)
    },
    saveMenus: ({ commit }, payload) => {
        commit('SAVEMENUS', payload)
    }

}
const mutations = {
    SAVELOGIN: (state, payload) => {
        state.token = payload.access_token

        // console.log('items', items)
    },
    SAVEMENUS: (state, payload) => {
        state.items = payload
    }

}
const getters = {
    getItems: state => state.items
}

export default {
    state,
    actions,
    mutations,
    getters
}